using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class BL_GuarBillingClassMap : EntityTypeConfiguration<BL_GuarBillingClass>
    {
        public BL_GuarBillingClassMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.Name)
                .HasMaxLength(50);

            this.Property(t => t.Code)
                .HasMaxLength(10);

            this.Property(t => t.Description)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Group)
                .HasMaxLength(20);

            this.Property(t => t.Part)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("BL_GuarBillingClass");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Code).HasColumnName("Code");
            this.Property(t => t.Report_Order).HasColumnName("Report Order");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.Group).HasColumnName("Group");
            this.Property(t => t.Part).HasColumnName("Part");
        }
    }
}
